package com.zg.sign.service.impl;

import com.zg.common.web.service.MinioService;
import com.zg.sign.service.SignService;
import com.zg.sign.util.CaSignUtil;
import com.zg.sign.vo.UploadUnsignedFilesVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;

@Slf4j
@Service
public class SignServiceImpl implements SignService {

    @Resource
    private  MinioService minioService;
    @Resource
    private CaSignUtil caSignUtil;

    @Override
    public UploadUnsignedFilesVo uploadUnsignedFile(MultipartFile file) throws IOException {
        UploadUnsignedFilesVo uploadUnsignedFilesVo = caSignUtil.uploadUnsignedFile(file);
        String path = minioService.upload(file);

        return uploadUnsignedFilesVo;
    }
}
